#lang racket


(require "global.rkt"
         "backends/main.rkt")

(provide with-session)


(define-syntax with-session
  (syntax-rules ()
    ((_ (b) body ...)
     (begin
       (begin-session! b)
       body ...
       (end-session! b)))
    ((_ body ...)
     (begin
       (begin-session! (current-out-backend))
       body ...
       (end-session! (current-out-backend))))))